package com.djinfo.work.service;

import com.alibaba.fastjson.support.odps.udf.CodecCheck;
import com.djinfo.work.common.bean.AjaxJson;
import com.djinfo.work.common.service.BaseService;
import com.djinfo.work.entity.TbSysMenu;
import com.djinfo.work.entity.TbSysRoleUser;
import com.djinfo.work.entity.TbSysRoles;
import com.djinfo.work.entity.TbSysUsers;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

/**
 * 实现 用户登录 首页导航
 *
 * @author wxf Service业务接口
 */
public interface UserService  extends BaseService<TbSysUsers> {

	/**
	 * 根据账号、密码登录验证
	 *
	 * @param username
	 * @param password
	 * @return
	 */
	String getUserID(String username, String password);
	List<TbSysRoles> getUserRoles(String UserId);
	/**
	 * 根据id主键 查询用户信息
	 *
	 * @param id
	 * @return
	 */
	TbSysUsers get(String id);

	/**
	 * 左侧导航显示 根据id查询导航菜单信息
	 *
	 * @param id
	 * @return
	 */
	List<TbSysMenu> authoritiesfindAll(Integer id);

	public List<TbSysUsers> getAllUser();
	public List<TbSysUsers> page(TbSysUsers tbDicRoles, Integer pageNum, Integer pageSize);
	public Integer getAllRowCount(TbSysUsers tbSysUsers);

	public void save(TbSysUsers tbSysUsers);
	public void saveRoleId(String RoleId,String UserId);
	public void updateRoleId(String pkRoleUserId,String roleId,String UserId);
	public void delete(String id);

	public Integer getUserID(String userCode);

	public TbSysUsers getUserByUserCode(String userCode);
	public void update(TbSysUsers tbSysUsers);
	public void saveRoleUser(TbSysRoleUser tbSysRoleUser);
	public void deleteOneUserRoles(String uid);


	public ArrayList<TbSysUsers> getUsers(String deptId);

	public List getUserRoleByUserId(String uid);

	public void deleteUserRoleByUserId(String uid);

	/**
	 * 获取用户列表信息   包含数据和总记录数
	 * @param tbSysUsers
	 * @param pagenum
	 * @param pagesize
     * @return
     */
	AjaxJson getDataList(TbSysUsers tbSysUsers, Integer pagenum, Integer pagesize);

	/**
	 * 获取当前用户的角色
	 * @param uid
	 * @return
     */
	AjaxJson getRoleUsers(String uid);

	/**
	 *角色编辑和用户角色绑定
	 * @param tbSysUsers
	 * @param roles
	 * @param request
     * @return
     */
	AjaxJson saveOrUpdate(TbSysUsers tbSysUsers, String[] roles, HttpServletRequest request);

	/**
	 * 删除用户
	 * @param tbSysUsers
	 * @return
     */
	public AjaxJson deleteUser(TbSysUsers tbSysUsers);

	/**
	 * 重置密码
	 * @param tbSysUsers
	 * @param request
     * @return
     */
	public AjaxJson rePsd(TbSysUsers tbSysUsers, HttpServletRequest request);

	/**
	 * 注册
	 * @param tbSysUsers
	 * @return
     */
	public AjaxJson addUser(TbSysUsers tbSysUsers);

	/**
	 * 修改密码客户端
	 * @param tbSysUsers
	 * @return
     */
	public AjaxJson resetPassword(TbSysUsers tbSysUsers);

	/**
	 * 检查该用户是否注册过
	 * @param phone
	 * @return
     */
	public AjaxJson checkPhone(String phone);


	public TbSysUsers getUserByUsername(String username);

	//mhq
	public List getQsList(String userId,String pName);

	public void deleteQsList();


}
